home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-19 / a7221v1b.zip / DEVLOPRS.DOC < prev    next >
Text File  |  1992-03-17  |  5KB  |  92 lines

  1.    This file is intended to provide information for persons wishing to use
  2.    the generic portions of the ADI7221 code to produce an ADI conversion
  3.    program for a device other than an HP 7221 series plotter.
  4.  
  5.    Please read the COPYING section of ADI7221.DOC before you begin modifying
  6.    or reusing any of the code in this package.
  7.  
  8.    While devloping the code for ADI7221, I tried to isolate all of the device
  9.    specific code into a few seperate modules.  My intension being that major
  10.    portions of this code could be reused to build ADI converters for other
  11.    devices.  As it now stands, the ADI7221 program consists of a main driver
  12.    with a few supporting procedures for file I/O and other generic functions,
  13.    and a set of device specific functions that produce the output codes used
  14.    by the HP7221.
  15.  
  16.    The device specific portions of ADI7221 are contained in the following
  17.    files in the ADI7221 directory:
  18.  
  19.       HP7221.C
  20.       HP7221.H
  21.       HPCODES.H
  22.       HPPARMS.C
  23.       HPPARMS.H
  24.  
  25.    These files should be replaced by your own device specific modules.  The
  26.    HPPARMS module contains supporting functions for the HP7221.C module;
  27.    your own device specific routines may or may not require a similar module.
  28.  
  29.    You will also have to edit the file MAKEFILE.MSC in the ADI7221 directory.
  30.    You should replace EXENAME and INSTALLNAME with the name of your
  31.    executable and the complete path to the installed version.  You should
  32.    modify DEVOBJS to reference your own device specific modules. You should
  33.    also replace the targets for the HP????? modules with targets for your own
  34.    modules, and modify the LINKFILE target to place your module names in
  35.    LINKFILE.
  36.  
  37.    The only modification you should have to make to the generic portions of
  38.    ADI7221 is a single #include statement in MAIN.C.  You should replace
  39.    the #include for HP7221.H with an include for the header file for your
  40.    top level device dependant module.  This module should provide the
  41.    following functions:
  42.  
  43.       int dev_beginplot(PLTFILE *outfile)
  44.       int dev_endplot(PLTFILE *outfile)
  45.       int dev_move(unsigned xcoord,ycoord; PLTFILE *outfile)
  46.       int dev_draw(unsigned xcoord,ycoord; PLTFILE *outfile)
  47.       int dev_newpen(unsigned pennum; PLTFILE *outfile)
  48.          Note: dev_newpen should initiate a hardware autoselect
  49.       int dev_setspeed(unsigned speed; PLTFILE *outfile)
  50.       int dev_linetype(unsigned linetype; PLTFILE *outfile)
  51.       int dev_penchange(PLTFILE *outfile)
  52.          Note: The main program calls dev_penchange and then pauses
  53.                for a manual pen change.  Since this version is not
  54.                a direct feed to the device, dev_penchange will
  55.                never be called.  However, future versions may use
  56.                this function.
  57.       int dev_abortplot(PLTFILE *outfile)
  58.  
  59.    Each of these functions must produce a char array of codes and output
  60.    those codes via the putarr function.  The putarr function and the PLTFILE
  61.    data type are part of the inout module.
  62.  
  63.    Each function should return an int value indicating it's success or
  64.    failure.  Values returned should be as follows:
  65.  
  66.       TRUE   - args (if any) converted successfully, no error was
  67.                returned by putarr()
  68.       BADIO  - putarr returned with an error
  69.       BADFMT - could not convert arguments to device format
  70.  
  71.    The #defines for the codes listed above can be found in retcodes.h.
  72.  
  73.    The device dependant code should also include a #define for DEV_WELCOME.
  74.    This should be a set of arguments for printf that will be printed at
  75.    program startup.  DEV_WELCOME should be defined in your equivalent of
  76.    HP7221.H.
  77.  
  78.  
  79.    Depending on the characteristics of your particular device, you may or may
  80.    not need to create the equivalent of SEND7221.  For most devices, it
  81.    should be possible to use the MS-DOS PRINT command to send your output to
  82.    the device.  SEND7221 was created for this version because the 7221
  83.    plotter uses a non-standard handshake method that was incompatible with
  84.    the PRINT command.  Creating SEND7221 also made it possible to use the
  85.    7221's buffer more efficiently.
  86.  
  87.    You are welcome to examine SEND7221 and reuse its code (under the
  88.    conditions outlined in SEND7221.DOC).  In particular, the COMIO module
  89.    was written to provide a more reliable method of accessing the serial
  90.    port on a PC.  This module may prove very useful if you need to
  91.    communicate directly with a device.
  92.